package com.zhoust.fastdome.business.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zhoust.fastdome.business.entity.CommonLog;
import org.aspectj.lang.ProceedingJoinPoint;

import javax.servlet.http.HttpServletRequest;

/**
 * (CommonLog)表服务接口
 *
 * @author makejava
 * @since 2021-09-22 17:37:53
 */
public interface CommonLogService extends IService<CommonLog> {

    /**
     * 获取参数插入日志表
     * @param responseBody
     * @param joinPoint
     */
    public void saveLog(String responseBody, ProceedingJoinPoint joinPoint);

    /**
     * 通过前置处理器获取参数插入日志表,异步执行
     * @param request
     */
    public void saveLogByHandler(HttpServletRequest request);

    /**
     * 通过后置处理器更新日志返回报文,异步执行
     * @param request
     * @param responseBody
     */
    public void updateLogByHandler(HttpServletRequest request, String responseBody);


    /**
     * 构造日志体
     * @param request
     * @param requestBody
     * @return
     */
    public CommonLog getCommonLog(HttpServletRequest request,String requestBody);

    /**
     * 获取请求参数
     * @param request
     * @param joinPoint
     * @return
     */
    public String getRequestBody(HttpServletRequest request, ProceedingJoinPoint joinPoint);

    }

